<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ page session="false" %>


<div class="container-breadcrumb">
    <div class="row ">
        <div class="col-sm-12">
            <ol class="breadcrumb">
                <li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
                <li class="active"><s:message code="menu.profile" text="User Info"/></li>
            </ol>
        </div>
    </div><!--/.row-->
</div>

<div id="container-content" class="container-content">
        <div class="panel panel-default">
            <div class="panel-heading">
                <s:message code="label.generic.password" text="Password"/> <c:out value="${user.adminName}"/>
            </div>
            <c:url var="savePassword" value="/users/savePassword"/>
            <form:form method="POST" commandName="password" action="${savePassword}" cssClass="form-horizontal">
                <div class="panel-body">
                    <form:errors path="*" cssClass="alert alert-error" element="div"/>
                    <div id="store.success" class="alert alert-success" style="
                    <c:choose>
                    <c:when test="${success!=null}">display:block;</c:when>
                    <c:otherwise>display:none;</c:otherwise></c:choose>"><s:message code="message.success"
                                                                                    text="Request successfull"/></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><s:message code="label.generic.password" text="Password"/></label>

                        <div class="col-sm-4">
                            <input type="password" name="password" id="password" class="form-control"/>
                            <span class="help-inline"><form:errors path="password" cssClass="error"/></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label"><s:message code="label.generic.newpassword" text="New password"/></label>

                        <div class="col-sm-4">
                            <input type="password" name="newPassword" id="newPassword"
                                   class="form-control"/>
                            <span class="help-inline"><form:errors path="newPassword" cssClass="error"/></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label"><s:message code="label.generic.newpassword.repeat" text="Repeat new password"/></label>

                        <div class="col-sm-4">
                            <input type="password" name="repeatPassword" id="repeatPassword"
                                   class="form-control"/>
                            <span class="help-inline"><form:errors path="repeatPassword" cssClass="error"/></span>
                        </div>
                    </div>
                    <form:hidden path="user.id"/>
                </div>
                <div class="panel-footer">
                    <button type="submit" class="btn btn-success"><s:message code="button.label.submit"
                                                                             text="Submit"/></button>
                </div>
            </form:form>

        </div>
    </div>
